﻿using System;
using System.Runtime.Serialization;

namespace Inaction
{
    [Serializable]
    public class EntityException : System.Exception
    {
        public string Title { get; set; }

        public EntityException(string title, string message)
            : base(message)
        {
            Title = title;
        }

        protected EntityException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            Title = info.GetString("Title");
        }

        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
            info.AddValue("Title", Title);
        }
    }
}
